package com.yangrd.helper.crudhelper.core.support;

import com.yangrd.helper.crudhelper.CrudHelperProperties;
import com.yangrd.helper.crudhelper.core.crud.page.DomainMappingManager;

/**
 * description: CtrlUrlSupport
 *
 * @author: yangrd
 * @date: 2020/11/4
 * @version: 1.0
 */
public class CtrlUrlSupport {

    private static CrudHelperProperties crudHelperProperties;

    public CtrlUrlSupport(CrudHelperProperties crudHelperProperties) {
        CtrlUrlSupport.crudHelperProperties = crudHelperProperties;
    }

    public static String getBaseCtrlUrl(Class<?> domainClass) {
        return String.format("%s/%s", crudHelperProperties.getContextPath(), DomainMappingManager.MappingSupport.getDomainName(domainClass));
    }

}
